﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FbKPI.Model;
using FbKPI.Controller;

namespace FbKPI.Facade.Validator
{
    public class EmployeeValidator
    {
        public string ValidateOnSave(Employee employees)
        {
            string msg = "OK";
            if (employees.FirstName.Trim().Length <= 0)
                msg = "Please Enter FirstName";
            if (employees.Department == null)
                msg = "Please Enter Department";
            //if (employees.Section == null)
            //    msg = "Please Enter Section";
            //if (employees.SubSection == null)
            //    msg = "Please Enter SubSection";
            if (employees.JobPosition == null)
                msg = "Please Enter JobPosition";
            if (employees.Email.Trim().Length <= 0)
                msg = "Please Enter Email";
            if (employees.SubBranch == null)
                msg = "Please Enter Sub Branch";
            if (employees.NIK.Trim().Length <= 0)
                msg = "Please Enter NIK";

            return msg;
        }

        public string ValidateOnUpdate(Employee employees)
        {
            string msg = "OK";
            if (employees.FirstName.Trim().Length <= 0)
                msg = "Please Enter FirstName";
            if (employees.Department == null)
                msg = "Please Enter Department";
            //if (employees.Section == null)
            //    msg = "Please Enter Section";
            //if (employees.SubSection == null)
            //    msg = "Please Enter SubSection";
            if (employees.JobPosition == null)
                msg = "Please Enter JobPosition";
            if (employees.Email.Trim().Length <= 0)
                msg = "Please Enter Email";
            if (employees.SubBranch == null)
                msg = "Please Enter Sub Branch";
            if (employees.NIK.Trim().Length <= 0)
                msg = "Please Enter NIK";
            return msg;
        }
    }
}